MULTIBODY SIMULATION SOFTWARE - API documentation

chrono::ChFile_ps Class Reference

#include <CHfilePS.h>

Inheritance diagram for chrono::ChFile_ps:

Inheritance graph
[legend]
Collaboration diagram for chrono::ChFile_ps:

Collaboration graph
[legend]

List of all members.

Public Types

enum  { PS_LEFT_JUSTIFIED = 0, PS_RIGHT_JUSTIFIED, PS_CENTER_JUSTIFIED }

Public Member Functions

 ChFile_ps (char *m_name, double x=1, double y=1, double w=20, double h=29, char *m_prolog_file="prolog.ps")
 ~ChFile_ps ()
ChPageVect Get_G_p ()
ChPageVect Get_Gs_p ()
ChPageVect Get_Gc_g ()
ChPageVect Get_Gz ()
void Set_G_p (ChPageVect mv)
void Set_Gs_p (ChPageVect mv)
void Set_Gc_g (ChPageVect mv)
void Set_Gz (double mz)
void Set_Gz (ChPageVect mz)
void Set_ZoomPan_by_fit (double Xgmin, double Xgmax, double Ygmin, double Ygmax)
ChPageVect To_page_from_graph (ChPageVect mv_g)
ChPageVect To_graph_from_page (ChPageVect mv_p)
ChPageVect TransPt (ChPageVect mfrom, int space)
void SetGray (double mf)
void SetWidth (double mf)
void SetLinecap (double mf)
void SetRGB (double r, double g, double b)
void SetRGB (ChFile_ps_color mc)
void SetFont (char *name, double size)
void CustomPsCommand (char *command)
void MoveTo (ChPageVect mp)
void StartLine ()
void AddLinePoint (ChPageVect mp)
void CloseLine ()
void PaintStroke ()
void PaintFill ()
void Clip ()
void GrSave ()
void GrRestore ()
void DrawPoint (ChPageVect mfrom, int space)
void DrawLine (ChPageVect mfrom, ChPageVect mto, int space)
void DrawRectangle (ChPageVect mfrom, ChPageVect mwh, int space, int filled)
void ClipRectangle (ChPageVect mfrom, ChPageVect mwh, int space)
void ClipToGraph ()
void DrawText (ChPageVect mfrom, char *string, int space, int justified=PS_LEFT_JUSTIFIED)
void DrawText (ChPageVect mfrom, double number, int space, int justified=PS_LEFT_JUSTIFIED)
void DrawGraphAxes (ChFile_ps_graph_setting *msetting)
void DrawGraphXY (ChMatrix<> *Yvalues, ChMatrix<> *Xvalues)
void DrawGraphXY (ChMatrix<> *Yvalues, double Xfrom, double Xstep)
void DrawGraphLabel (double dx, double dy, double fontsize, char *label, int dolinesample, bool background=true, double backwidth=3.0, ChFile_ps_color bkgndcolor=PS_COLOR_WHITE)

Protected Attributes

double unit_scale
ChPageVect page_size
ChPageVect G_p
ChPageVect Gs_p
ChPageVect Gc_g
ChPageVect Gz
char prolog_file [150]


Detailed Description

Class for postScript(TM) output. Defines special file class CHfile_ps for EPS or PS output, i.e. Encapsulated PostScript or PostScript (TM) files incuding vectorial plots, graphs, lines, fonts, etc.

Constructor & Destructor Documentation

chrono::ChFile_ps::ChFile_ps ( char *  m_name,
double  x = 1,
double  y = 1,
double  w = 20,
double  h = 29,
char *  m_prolog_file = "prolog.ps" 
)

Constructor, with optional position and size of bounding box.

chrono::ChFile_ps::~ChFile_ps (  ) 

Destructor. Write trailer to PS file and close it.


Member Function Documentation

ChPageVect chrono::ChFile_ps::Get_G_p (  ) 

Get viewport position of left-lower graph corner, in page space.

ChPageVect chrono::ChFile_ps::Get_Gs_p (  ) 

Get viewport width/height of graph, in page space.

ChPageVect chrono::ChFile_ps::Get_Gc_g (  ) 

Get viewport center, in 2d graph space;.

ChPageVect chrono::ChFile_ps::Get_Gz (  ) 

Get viewport graph zoom factor:.

void chrono::ChFile_ps::Set_G_p ( ChPageVect  mv  ) 

Set viewport position of left-lower graph corner, in page space.

void chrono::ChFile_ps::Set_Gs_p ( ChPageVect  mv  ) 

Set viewport width/height of graph, in page space.

void chrono::ChFile_ps::Set_Gc_g ( ChPageVect  mv  ) 

Set viewport center, in 2d graph space;.

void chrono::ChFile_ps::Set_Gz ( double  mz  ) 

Set viewport graph zoom factor:.

void chrono::ChFile_ps::Set_Gz ( ChPageVect  mz  ) 

Set viewport graph zoom factor:.

void chrono::ChFile_ps::Set_ZoomPan_by_fit ( double  Xgmin,
double  Xgmax,
double  Ygmin,
double  Ygmax 
)

Set viewport zoom and pan (center) given the max/min extension in graph space

ChPageVect chrono::ChFile_ps::To_page_from_graph ( ChPageVect  mv_g  ) 

Trasform position from 'page space' to 'graph viewport space'.

ChPageVect chrono::ChFile_ps::To_graph_from_page ( ChPageVect  mv_p  ) 

Trasform position from 'graph viewport space' to 'page space',.

void chrono::ChFile_ps::SetGray ( double  mf  ) 

Sets the gray level of next drawn item, 0..1.

void chrono::ChFile_ps::SetWidth ( double  mf  ) 

Sets the width of next drawn line.

void chrono::ChFile_ps::SetLinecap ( double  mf  ) 

Sets the linecap.

void chrono::ChFile_ps::SetRGB ( double  r,
double  g,
double  b 
)

Sets the RGB color of next drawn item.

void chrono::ChFile_ps::SetRGB ( ChFile_ps_color  mc  ) 

Sets the color of next drawn item.

void chrono::ChFile_ps::SetFont ( char *  name,
double  size 
)

Sets the font of next drawn text (note: must use PS embedded fonts like "Times-Roman", etc.)

void chrono::ChFile_ps::DrawPoint ( ChPageVect  mfrom,
int  space 
)

Draws a single "dot" point,.

void chrono::ChFile_ps::DrawLine ( ChPageVect  mfrom,
ChPageVect  mto,
int  space 
)

Draws line from point to point,.

void chrono::ChFile_ps::DrawRectangle ( ChPageVect  mfrom,
ChPageVect  mwh,
int  space,
int  filled 
)

Draws rectangle from point to point.

void chrono::ChFile_ps::ClipRectangle ( ChPageVect  mfrom,
ChPageVect  mwh,
int  space 
)

Sets clip rectangle draw region, from point to point (remember GrSave() and GrRestore() before and later..).

void chrono::ChFile_ps::ClipToGraph (  ) 

Sets clip rectangle as graph region (remember GrSave() and GrRestore() before and later..).

void chrono::ChFile_ps::DrawText ( ChPageVect  mfrom,
char *  string,
int  space,
int  justified = PS_LEFT_JUSTIFIED 
)

Draw text at given position.

void chrono::ChFile_ps::DrawText ( ChPageVect  mfrom,
double  number,
int  space,
int  justified = PS_LEFT_JUSTIFIED 
)

Draw number at given position.

void chrono::ChFile_ps::DrawGraphAxes ( ChFile_ps_graph_setting msetting  ) 

Draw the x/y axes for the graph viewport.

void chrono::ChFile_ps::DrawGraphXY ( ChMatrix<> *  Yvalues,
ChMatrix<> *  Xvalues 
)

Draw a line into graph viewport, where the xy coords are stored in two separate arrays:

void chrono::ChFile_ps::DrawGraphXY ( ChMatrix<> *  Yvalues,
double  Xfrom,
double  Xstep 
)

Draw a line into graph viewport, where the y coords are into an array and x coords run form Xfrom... with steps Xsteps-

void chrono::ChFile_ps::DrawGraphLabel ( double  dx,
double  dy,
double  fontsize,
char *  label,
int  dolinesample,
bool  background = true,
double  backwidth = 3.0,
ChFile_ps_color  bkgndcolor = PS_COLOR_WHITE 
)

Draws a text label (with "fontsize" size) with postion relative to low-left corner of graph. If "dolinesample= true", also draws a little horizontal sample of line with current width/colour on the left of the label.


CHRONO::ENGINE
C++ library for multibody simulation, (C) Alessandro Tasora
This API documentation has been generated on 17 Jul 2009 by Doxygen