// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const double turn_angle = 30);
};
/**
- * Flags fog XFig output.
+ * Flags for XFig output.
*/
struct XFig
{
* is forwarded to XFig.
*/
int line_style;
- /**
+
+ /**
+ * Thickness of border lines of
+ * polygons. Default is 1.
+ *
+ * Set this to zero to avoid
+ * border lines for very fine
+ * meshes.
+ */
+ int line_thickness;
+
+ /**
* Style for drawing lines at the
* boundary. Defaults to solid (0).
*/
int boundary_style;
+ /**
+ * Thickness of boundary
+ * lines. Default is 3.
+ */
+ int boundary_thickness;
+
/**
* Constructor.
*/
/**
- * This class provides a means to output a triangulation to a file in different
- * formats. Presently provided are functions to write it in GNUPLOT and
- * encapsulated postscript format, as well as in UCD format.
- * There are also function to dispatch to
- * the different output functions based on a parameter given, e.g., through
- * a parameter file, thus making user programs invariant of the number and
- * names of the file formats implemented in this class. The main advantage of
- * this class over the DataOut class is that it does not have to mess around
- * with actual data vectors and that no DoFHandler object is needed to
- * write the pure geometrical information involved here.
- *
- * Available output formats can be found in the functions with names <tt>write_...</tt>
+ * This class provides a means to output a triangulation to a file in
+ * different formats. See the enum GridOut::OutputFormat for a list of formats
+ * and the corresponding output function names.
*
* @sect3{Usage}
* Usage is simple: either you use the direct form
{
public:
/**
- * Declaration of a name for each of the
- * different output formats.
+ * Declaration of a name for each
+ * of the different output
+ * formats. These are used by the
+ * generic output function
+ * write() to determine the
+ * actual output format.
*/
- enum OutputFormat { dx, gnuplot, eps, ucd, xfig };
-
+ enum OutputFormat
+ {
+ /// Do nothing in write()
+ none,
+ /// write() calls write_dx()
+ dx,
+ /// write() calls write_gnuplot()
+ gnuplot,
+ /// write() calls write_eps()
+ eps,
+ /// write() calls write_ucd()
+ ucd,
+ /// write() calls write_xfig()
+ xfig
+ };
+
/**
* Write triangulation in OpenDX
* format.
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
scaling(1.,1.),
fill_style (20),
line_style(0),
- boundary_style(0)
+ line_thickness(1),
+ boundary_style(0),
+ boundary_thickness(3)
{}
} // end namespace GridOutFlags
{
switch (output_format)
{
+ case none:
+ return "";
case dx:
return ".dx";
case gnuplot:
- return ".gnuplot";
-
+ return ".gnuplot";
case ucd:
- return ".inp";
-
+ return ".inp";
case eps:
- return ".eps";
-
+ return ".eps";
case xfig:
- return ".fig";
+ return ".fig";
default:
Assert (false, ExcNotImplemented());
return "";
GridOut::OutputFormat
GridOut::parse_output_format (const std::string &format_name)
{
+ if (format_name == "none" || format_name == "false")
+ return none;
+
if (format_name == "dx")
return dx;
std::string GridOut::get_output_format_names ()
{
- return "dx|gnuplot|eps|ucd|xfig";
+ return "none|dx|gnuplot|eps|ucd|xfig";
}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
<< "A4\n100.00\nSingle" << std::endl
// Background is transparent
<< "-3" << std::endl
+ << "# generated by deal.II GridOut class" << std::endl
+ << "# reduce first number to scale up image" << std::endl
<< "1200 2" << std::endl;
// We write all cells and cells on
continue;
// Code for polygon
out << "2 3 "
- // with black line thickness 1
- << xfig_flags.line_style
- <<" 1 0 ";
+ << xfig_flags.line_style << ' '
+ << xfig_flags.line_thickness
+ // with black line
+ << " 0 ";
// Fill color
if (xfig_flags.level_color)
out << cell->level() + 8;
{
// Code for polyline
out << "2 1 "
- // with line thickness 3
- << xfig_flags.boundary_style
- << " 3 ";
- out << (1 + (unsigned int) bi);
+ // with line style and thickness
+ << xfig_flags.boundary_style << ' '
+ << xfig_flags.boundary_thickness << ' '
+ << (1 + (unsigned int) bi);
// Fill color
out << " -1 ";
- // Depth, unused, no fill
+ // Depth 100 less than cells
out << (xfig_flags.level_depth
? (800-cell->level())
- : 800+bi)
+ : 800+bi)
+ // unused, no fill
<< " 0 -1 0.0 "
// some style parameters
<< " 0 0 -1 0 0 "
{
switch (output_format)
{
+ case none:
+ return;
+
case dx:
- write_dx (tria, out);
- return;
-
+ write_dx (tria, out);
+ return;
+
case ucd:
- write_ucd (tria, out);
- return;
-
+ write_ucd (tria, out);
+ return;
+
case gnuplot:
- write_gnuplot (tria, out, mapping);
- return;
-
+ write_gnuplot (tria, out, mapping);
+ return;
+
case eps:
- write_eps (tria, out, mapping);
- return;
-
+ write_eps (tria, out, mapping);
+ return;
+
case xfig:
- write_xfig (tria, out, mapping);
- return;
- };
-
+ write_xfig (tria, out, mapping);
+ return;
+ }
+
Assert (false, ExcInternalError());
}