const double azimut_angle = 60,
const double turn_angle = 30);
};
+ /**
+ * Flags fog XFig output.
+ */
+ struct XFig
+ {
+ /**
+ * Method for filling cells
+ */
+ unsigned int fill_style;
+ /**
+ * Draw boundary lines.
+ */
+ bool draw_boundary;
+ /**
+ * Change color depending on level.
+ */
+ bool level_color;
+ /**
+ * Code level to depth.
+ */
+ bool level_depth;
+ /**
+ * Additional points for curved
+ * boundaries.
+ */
+ unsigned int n_boundary_face_points;
+
+ /**
+ * Scaling of graph. The
+ * default is a unit length of
+ * one inch.
+ */
+ Point<2> scaling;
+ /**
+ * Offset of the graph. Before
+ * scaling, the coordinates are
+ * shifted by this
+ * value. Default is zero in
+ * each direction.
+ */
+ Point<2> offset;
+
+ /**
+ * Constructor.
+ */
+ XFig();
+ };
+
}
* Declaration of a name for each of the
* different output formats.
*/
- enum OutputFormat { dx, gnuplot, eps, ucd };
+ enum OutputFormat { dx, gnuplot, eps, ucd, xfig };
/**
* Write triangulation in OpenDX
void write_eps (const Triangulation<1> &tria,
std::ostream &out,
const Mapping<1> *mapping=0);
-
+
+ /**
+ * Write XFig-file.
+ */
+ template <int dim>
+ void write_xfig (const Triangulation<dim> &tria,
+ std::ostream &out,
+ const Mapping<dim> *mapping=0);
/**
* Write data and grid to @p{out} according
* to the given data format. This function
*/
void set_flags (const GridOutFlags::Eps<3> &flags);
+ /**
+ * Set flags for EPS output of a
+ * three-dimensional triangulation
+ */
+ void set_flags (const GridOutFlags::XFig &flags);
+
/**
* Provide a function which tells us which
* suffix with a given output format
* function.
*/
GridOutFlags::Eps<3> eps_flags_3;
-
-
+
+ /**
+ * Flags used for XFig output.
+ */
+ GridOutFlags::XFig xfig_flags;
+
/**
* Write the grid information about
* faces to @p{out}. Only those faces
azimut_angle (azimut_angle),
turn_angle (turn_angle)
{}
+
+
+ XFig::XFig ()
+ : fill_style (20), // filled
+ draw_boundary(true),
+ level_color(false),
+ level_depth(true),
+ n_boundary_face_points(0),
+ scaling(1.,1.)
+ {}
} // end namespace GridOutFlags
+void GridOut::set_flags (const GridOutFlags::XFig &flags)
+{
+ xfig_flags = flags;
+}
+
+
+
std::string
GridOut::default_suffix (const OutputFormat output_format)
{
case eps:
return ".eps";
-
+
+ case xfig:
+ return ".fig";
default:
Assert (false, ExcNotImplemented());
return "";
if (format_name == "eps")
return eps;
+ if (format_name == "xfig")
+ return xfig;
+
AssertThrow (false, ExcInvalidState ());
// return something weird
return OutputFormat(-1);
std::string GridOut::get_output_format_names ()
{
- return "dx|gnuplot|eps|ucd";
+ return "dx|gnuplot|eps|ucd|xfig";
}
sizeof(gnuplot_flags) +
sizeof(eps_flags_1) +
sizeof(eps_flags_2) +
- sizeof(eps_flags_3));
+ sizeof(eps_flags_3) +
+ sizeof(xfig_flags));
}
}
+#if deal_II_dimension != 2
+
+template <int dim>
+void GridOut::write_xfig (const Triangulation<dim> &,
+ std::ostream &)
+{
+ Assert (false, ExcNotImplemented());
+}
+
+#else
+
+template <int dim>
+void GridOut::write_xfig (const Triangulation<dim> &,
+ std::ostream &)
+{
+ Assert (false, ExcNotImplemented());
+}
+#endif
+
+
#if deal_II_dimension == 1