Ejemplo n.º 1
0
void HPGL_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
                                double aScale, bool aMirror )
{
    plotOffset  = aOffset;
    plotScale   = aScale;
    m_IUsPerDecimil = aIusPerDecimil;
    iuPerDeviceUnit = PLUsPERDECIMIL / aIusPerDecimil;
    /* Compute the paper size in IUs */
    paperSize   = pageInfo.GetSizeMils();
    paperSize.x *= 10.0 * aIusPerDecimil;
    paperSize.y *= 10.0 * aIusPerDecimil;
    SetDefaultLineWidth( 0 );    // HPGL has pen sizes instead
    m_plotMirror = aMirror;
}
Ejemplo n.º 2
0
void PS_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
			      double aScale, bool aMirror )
{
    wxASSERT( !outputFile );
    m_plotMirror = aMirror;
    plotOffset = aOffset;
    plotScale = aScale;
    m_IUsPerDecimil = aIusPerDecimil;
    iuPerDeviceUnit = 1.0 / aIusPerDecimil;
    /* Compute the paper size in IUs */
    paperSize = pageInfo.GetSizeMils();
    paperSize.x *= 10.0 * aIusPerDecimil;
    paperSize.y *= 10.0 * aIusPerDecimil;
    SetDefaultLineWidth( 100 * aIusPerDecimil );  // arbitrary default
}
void PDF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
                              double aScale, bool aMirror )
{
    m_plotMirror = aMirror;
    plotOffset = aOffset;
    plotScale = aScale;
    m_IUsPerDecimil = aIusPerDecimil;

    // The CTM is set to 1 user unit per decimil
    iuPerDeviceUnit = 1.0 / aIusPerDecimil;

    SetDefaultLineWidth( 100 / iuPerDeviceUnit );  // arbitrary default

    /* The paper size in this engined is handled page by page
       Look in the StartPage function */
}
void GERBER_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
				  double aScale, bool aMirror )
{
    wxASSERT( aMirror == false );
    m_plotMirror = false;
    plotOffset = aOffset;
    wxASSERT( aScale == 1 );    // aScale parameter is not used in Gerber
    plotScale = 1;              // Plot scale is *always* 1.0

    m_IUsPerDecimil = aIusPerDecimil;
    // gives now a default value to iuPerDeviceUnit (because the units of the caller is now known)
    // which could be modified later by calling SetGerberCoordinatesFormat()
    iuPerDeviceUnit = pow( 10.0, m_gerberUnitFmt ) / ( m_IUsPerDecimil * 10000.0 );

    // We don't handle the filmbox, and it's more useful to keep the
    // origin at the origin
    paperSize.x = 0;
    paperSize.y = 0;
    SetDefaultLineWidth( 100 * aIusPerDecimil ); // Arbitrary default
}
/**
 * Starts a new page in the PDF document
 */
void PDF_PLOTTER::StartPage()
{
    wxASSERT( outputFile );
    wxASSERT( !workFile );

    // Compute the paper size in IUs
    paperSize = pageInfo.GetSizeMils();
    paperSize.x *= 10.0 / iuPerDeviceUnit;
    paperSize.y *= 10.0 / iuPerDeviceUnit;
    SetDefaultLineWidth( 100 / iuPerDeviceUnit );  // arbitrary default

    // Open the content stream; the page object will go later
    pageStreamHandle = startPdfStream();

    /* Now, until ClosePage *everything* must be wrote in workFile, to be
       compressed later in closePdfStream */

    // Default graphic settings (coordinate system, default color and line style)
    fprintf( workFile,
             "%g 0 0 %g 0 0 cm 1 J 1 j 0 0 0 rg 0 0 0 RG %g w\n",
             0.0072 * plotScaleAdjX, 0.0072 * plotScaleAdjY,
             userToDeviceSize( defaultPenWidth ) );
}
Ejemplo n.º 6
0
/**
 * Set the scale/position for the DXF plot
 * The DXF engine doesn't support line widths and mirroring. The output
 * coordinate system is in the first quadrant (in mm)
 */
void DXF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
                               double aScale, bool aMirror )
{
    plotOffset  = aOffset;
    plotScale   = aScale;

    /* DXF paper is 'virtual' so there is no need of a paper size.
       Also this way we can handle the aux origin which can be useful
       (for example when aligning to a mechanical drawing) */
    paperSize.x = 0;
    paperSize.y = 0;

    /* Like paper size DXF units are abstract too. Anyway there is a
     * system variable (MEASUREMENT) which will be set to 1 to indicate
     * metric units */
    m_IUsPerDecimil = aIusPerDecimil;
    iuPerDeviceUnit = 1.0 / aIusPerDecimil; // Gives a DXF in decimils
    iuPerDeviceUnit *= 0.00254;             // ... now in mm

    SetDefaultLineWidth( 0 );               // No line width on DXF
    m_plotMirror = false;                     // No mirroring on DXF
    m_currentColor = COLOR4D::BLACK;
}