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

« back to all changes in this revision

Viewing changes to src/cadxcore/api/iwidgetsrenderer.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: iwidgetsrenderer.h 3526 2011-03-16 19:56:19Z carlos $
 
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
#pragma once
 
14
#include <api/api.h>
 
15
#include <api/ievento.h>
 
16
#include <api/math/geometria.h>
 
17
 
 
18
//----------------------------------------------------------------------------------------------------
 
19
// Forward declarations
 
20
 
 
21
namespace GNC {
 
22
        namespace GCS {
 
23
                class IImpresorOverlay;
 
24
                class IWidgetsManager;
 
25
                
 
26
                namespace Widgets {
 
27
                  class IWidget;
 
28
                  class IWidgetBuilder;          
 
29
                }
 
30
        }
 
31
}
 
32
 
 
33
class vtkGinkgoImageViewer;
 
34
class vtkWorldPointPicker;
 
35
class WidgetRepresentation;
 
36
class wxWindow;
 
37
 
 
38
// End Forward declarations
 
39
 
 
40
namespace GNC {
 
41
        namespace GCS {
 
42
 
 
43
                /* Clase que solicita al modelo de widgets que redibuje sus widgets */
 
44
                class EXTAPI IWidgetsRenderer : public GNC::GCS::Eventos::IPublicadorEventos {
 
45
                public:
 
46
                        typedef GNC::GCS::Contexto3D TContexto;
 
47
 
 
48
                        TContexto* m_c;
 
49
                        IImpresorOverlay* m_pIOverlay;
 
50
 
 
51
                        IWidgetsRenderer();
 
52
 
 
53
                        ~IWidgetsRenderer();
 
54
                        
 
55
                /* Metodo que indica al manager que es preciso hacer un render() */
 
56
                void Modificar(bool modificar)
 
57
                {
 
58
                        m_Modificado = modificar;
 
59
                }
 
60
                        
 
61
                inline bool EstaModificado()
 
62
                {
 
63
                        return m_Modificado;
 
64
                }
 
65
 
 
66
                //----------------------------------------------------------------------------------------------------
 
67
                //region "Interfaz de impresión de overlays"
 
68
 
 
69
                public:
 
70
 
 
71
                        void SetIOverlay(IImpresorOverlay* pOverlay);
 
72
 
 
73
                        void ImprimirOverlay(GNC::GCS::Widgets::IWidget* w, GNC::GCS::Contexto3D* c, GNC::GCS::Vector& boundingBox);
 
74
 
 
75
                        void ImprimirOverlay(GNC::GCS::Widgets::IWidgetBuilder* wb, GNC::GCS::Contexto3D* c, GNC::GCS::Vector& boundingBox);
 
76
 
 
77
                //----------------------------------------------------------------------------------------------------
 
78
                //region "Interfaz de configuracion de vistas/slices"
 
79
 
 
80
                public:
 
81
                        
 
82
                        /* Propaga la notificación de activación de este renderer hacia el manager */
 
83
                        void Activar();
 
84
                        
 
85
                        /* Establece el id de sub-vista activo. Los widgets se asocian a un VID. */
 
86
                        void SetVID(long vid, bool render);
 
87
                        
 
88
                        /* Obtiene el id de sub-vista activo. Los widgets se asocian a un VID. */
 
89
                        inline long GetVID(void)
 
90
                        {
 
91
                                return m_VID;
 
92
                        }
 
93
 
 
94
                protected:
 
95
                        
 
96
                        /* Propaga la notificación de activación de este renderer hacia las clases base */
 
97
                        virtual void OnActivar();
 
98
                        
 
99
                        long m_VID;
 
100
 
 
101
                //----------------------------------------------------------------------------------------------------
 
102
                //region "Interfaz de configuracion del manager"
 
103
 
 
104
                public:
 
105
                        void SetManager(GNC::GCS::IWidgetsManager* pManager);
 
106
 
 
107
                        void SetRepresentation(WidgetRepresentation* pWidget);
 
108
 
 
109
                        virtual void WSetCurrent() = 0;
 
110
 
 
111
                protected:
 
112
                        GNC::GCS::IWidgetsManager*      m_pManager;
 
113
 
 
114
                //endregion
 
115
                
 
116
                //----------------------------------------------------------------------------------------------------
 
117
                //region "Interfaz de transformacion de coordenadas"
 
118
                public:
 
119
                        virtual void DisplayToWorld(double displayPos[3], double worldPos[4]) = 0;
 
120
                        virtual void WorldToDisplay(double worldPos[4], double displayPos[3]) = 0;
 
121
                //endregion
 
122
 
 
123
                protected:
 
124
 
 
125
                public:
 
126
                        virtual void PostRender(bool inmediato = false) = 0;
 
127
 
 
128
                public:
 
129
                        vtkGinkgoImageViewer* m_pImageViewer;
 
130
                        vtkWorldPointPicker*  m_pPicker;
 
131
                        WidgetRepresentation* m_pRepresentation;
 
132
                        std::string sid;
 
133
                        bool                  m_Modificado;
 
134
                };
 
135
        }
 
136
}