~ubuntu-branches/ubuntu/wily/ginkgocadx/wily-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/api/iimpresion.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Tille
  • Date: 2011-05-02 08:09:26 UTC
  • Revision ID: james.westby@ubuntu.com-20110502080926-bql5wep49c7hg91t
Tags: upstream-2.4.1.1
ImportĀ upstreamĀ versionĀ 2.4.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  
 
3
 *  $Id: iimpresion.h 3713 2011-04-15 12:55:23Z tovar $
 
4
 *  Ginkgo CADx Project
 
5
 *
 
6
 *  Copyright 2008-10 MetaEmotion S.L. All rights reserved.
 
7
 *  http://ginkgo-cadx.com
 
8
 *
 
9
 *  This file is licensed under LGPL v3 license.
 
10
 *  See License.txt for details
 
11
 *
 
12
 */
 
13
// Forward declarations
 
14
#pragma once
 
15
#include <api/api.h>
 
16
#include <api/icontextoestudio.h>
 
17
#include <export/icontratoscore.h>
 
18
 
 
19
namespace GNC {
 
20
        namespace GCS {
 
21
                class IWidgetsManager;
 
22
                class IWidgetsRenderer;
 
23
        }
 
24
}
 
25
 
 
26
namespace GNC {
 
27
        namespace GCS {
 
28
 
 
29
                // Clase con helpers de impresion. Base comun de todas las interfaces de impresion de vistas.
 
30
                class EXTAPI IImpresion  {
 
31
                public:
 
32
 
 
33
                        IImpresion(GNC::GCS::IWidgetsManager* pWidgetsManager, const GnkPtr<GNC::GCS::IContextoEstudio>& pContextoEstudio, int index);
 
34
 
 
35
                        ~IImpresion()
 
36
                        {
 
37
                                m_pWidgetsManager = NULL;
 
38
                        }
 
39
 
 
40
                        //region "helpers"
 
41
                public:
 
42
                        void CopiarRGBEnRGBA32(unsigned char* src, unsigned char* dst, unsigned int size)
 
43
                        {
 
44
                                for (unsigned int off = 0; off < size; ++off) {
 
45
                                        dst[0] = src[2];
 
46
                                        dst[1] = src[1];
 
47
                                        dst[2] = src[0];
 
48
                                        dst[3] = 255;
 
49
                                        src+=3;
 
50
                                        dst+=4;
 
51
                                }
 
52
                        }
 
53
                        void CopiarRGBA32EnRGB(unsigned char* src, unsigned char* dst, unsigned int size)
 
54
                        {
 
55
                                for (unsigned int off = 0; off < size; ++off) {
 
56
                                        dst[0] = src[2];
 
57
                                        dst[1] = src[1];
 
58
                                        dst[2] = src[0];
 
59
                                        src+=4;
 
60
                                        dst+=3;
 
61
                                }
 
62
                        }
 
63
                        //endregion
 
64
 
 
65
                protected:
 
66
                        vtkSmartPointer<vtkImageData> GetImage();
 
67
 
 
68
                        void Imprimir(vtkImageData* imageData, bool conWidgets, const GNC::GCS::Vector& size, GNC::GCS::IContratoExportacionImages::ImageType::Pointer& out);
 
69
 
 
70
                        void ImprimirConWidgets(GNC::GCS::IContratoExportacionImages::ImageType::Pointer& img, const GNC::GCS::Vector& aspectRatio);
 
71
 
 
72
                        GNC::GCS::IWidgetsManager*  m_pWidgetsManager;
 
73
                        GnkPtr<GNC::GCS::IContextoEstudioReferido> m_pEstudioReferido;
 
74
                        int m_index;
 
75
                };
 
76
        }
 
77
}